#include <iostream>
using namespace std;

int main(){
	int year = 2000;
	int mon[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	int index[13]={0,3,3,0,3,2,3,2,3,3,2,3,2};
	int sum = 0;
	int cnt = 0;
	int day = 3;
	for(int i = 2000;i <= 2020;i++){
		if((i%4==0&&i%100!=0)||(i%400==0)){
			mon[2]=29;
			index[3]=1;
		}else{
			mon[2]=28;
			index[3]=0; 
		}
		for(int j = 1;j <= 12;j++){
			if(i==2020&&j==10){
				break;
			}
			sum+=mon[j];
			day += index[j];
			if(day > 7){
				day = day%7;
			}
			if(day == 1){
				cnt++;
			}
		}
	
	}
	
	sum++;
	
	int week= (sum+2)/7;
	
	sum = sum+week+12*20+10-cnt;
	
	cout<<day<<endl;
	cout<<sum<<endl; 
	
	system("pause");
	return 0;
} 
